﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Obligatorio2013.Persistencia;

namespace Obligatorio2013.Clases
{
    public class Users
    {
        #region Properties
        public string UserName { get; set; }
        public string UserLastName { get; set; }
        public string UserAddress { get; set; }
        public string UserAddressLocaltion { get; set; }
        public string UserPhone { get; set; }
        public string UserEmail { get; set; }
        public string User { get; set; }
        public string UserPass { get; set; }
        public string UserRole { get; set; }

        public bool UserActive { get; set; }
        public DateTime UserInactiveUntil { get; set; }
        public roles Role { get; set; }

        public enum roles { Guest, Publicator, Administrator}

        #endregion

        #region Constructors

        public Users(string uName, string uLastName, string uAddress, string uLocation, string phone, string email, 
            string user, string pass, string role)
        {
            this.UserName = uName;
            this.UserLastName = uLastName;
            this.UserAddress = uAddress;
            this.UserAddressLocaltion = uLocation;
            this.UserPhone = phone;
            this.UserEmail = email;
            this.User = user;
            this.UserPass = pass;   
            this.UserRole = role;
            this.UserActive = true;

        }

        public Users() { }
        #endregion


        #region Methods

        public override bool Equals(object obj)
        {
            Users otherUsr = obj as Users;
            return this.UserEmail == otherUsr.UserEmail;
        }
        public override int GetHashCode()
        {
            return base.GetHashCode();
        }

        public override string ToString()
        {
            return UserName+ " " + UserLastName;
        }
        #endregion



    }
}